<?php

ini_set("soap.wsdl_cache_enabled", "0");

require_once dirname(__FILE__) . '/Nette/Object.php';
require_once dirname(__FILE__) . '/Nette/Debug.php';
require_once dirname(__FILE__) . '/Texy/texy.compact.php';

Debug::enable();

class TexyService extends Object {
	
	const VERSION = "Texy! WS 2.0";
	
	private $texy;
	
	public function __construct($texy) {
		$this->texy = $texy;
	}

	public function version() {
		return self::VERSION;
	}
	
	public function process($text, $params = NULL) {
		
		return $this->texy->process($text);
	}
}

$texy = new Texy();
$server = new SoapServer(NULL, array('uri' => "http://texy.info/"));
$server->setClass('TexyService', $texy);
$server->handle();